package jihe;

import java.util.ArrayList;
import java.util.Collection;

public class Test1 {
	public static void main(String[] args) {
		Collection<String> c=new ArrayList<>();
		Collection<String> b=new ArrayList<>();
		c.add("aaa");
		c.add("abc");
		c.add("abbbb");
		/*String[] o=c.toArray(new String[]{});
		for(int i=0;i<o.length;i++){
			System.out.print(o[i]+" ");
		}
		System.out.println();*/
		/*Iterator<String> it =c.iterator();
		while(it.hasNext()){
			System.out.print(it.next()+" ");
		}*/
		//c.clear();
		b.add("124");
		b.remove("004");
		//b.removeAll(b);
		c.addAll(b);
		c.remove("abc");
		//c.removeAll(c);
		System.out.print("集合是否相等:");
		if(c.equals(b)){
			System.out.println("ture");
		}
		else
			System.out.println("false");
		System.out.print("c集合:");
		for(String s:c){
			System.out.print(s+" ");			
		}
		System.out.println();
 		System.out.println("集合长度:"+c.size());
 		System.out.println("哈希值:"+c.hashCode());
 		System.out.println("集合是否为空:"+c.isEmpty());
 		System.out.print("b集合:");
 		for(String s:b){
			System.out.print(s+" ");
		}
	}
}
